<?php

/***  DOCUMENTATION LAYER

	Greqo Blogger Express Library

	Last Update: Mar 2007
	Author: Tom at klenwell@gmail.com

	FUNCTIONS
		greqo_blogger_quick_post($body, $title, $blog_id='default')


  NOTES

______________________________________________________________________________*/


// greqo_blogger_quick_post
// NOTE: first, must require_once('../blogger_data.inc.php'); or set $GREQO['BLOGGER']['user'], $GREQO['BLOGGER']['password'] manually
/*____________________________________________________________________________*/
function greqo_blogger_quick_post($body, $title, $blog_id='default')
{
// *** DATA

	// internal
	$_LOGIN = array();
	$_TRIGGER['post'] = 0;

	// return
	$POST_DATA = array();
	
	
// *** MANIPULATE

	// get user data
	$_LOGIN = greqo_blogger_get_user_data();
	
	// default blog id?
	if ( $blog_id == 'default' ) $blog_id = $_LOGIN['blog_id'];
	
	
	// get auth token
	if ( greqo_request_clientlogin_token($_LOGIN['user'], $_LOGIN['password'], 'blogger', 1) ) 
	{
		$_TRIGGER['post'] = 1;
	}
	else
	{
		trigger_error('unable to retrieve token', E_USER_WARNING);
		return 0;
	}
	
	// post
	if ( !$POST_DATA = greqo_blogger_post_entry($body, $title, $blog_id) )
	{
		trigger_error('post failed', E_USER_WARNING);
		return 0;
	}

// *** RETURN

	return $POST_DATA;
	
} // end Fx
/*____________________________________________________________________________*/


?>
